package org.jeecg.modules.nurse_home_addr.service.impl;

import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.modules.nurse_goods.mapper.NurseGoodsMapper;
import org.jeecg.modules.nurse_home_addr.entity.NurseHomeAddr;
import org.jeecg.modules.nurse_home_addr.mapper.NurseHomeAddrMapper;
import org.jeecg.modules.nurse_home_addr.service.INurseHomeAddrService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: 用户家庭地址
 * @Author: jeecg-boot
 * @Date:   2025-06-26
 * @Version: V1.0
 */
@Service
public class NurseHomeAddrServiceImpl extends ServiceImpl<NurseHomeAddrMapper, NurseHomeAddr> implements INurseHomeAddrService {

    @Autowired
    private NurseHomeAddrMapper nurseHomeAddrMapper;

    @Override
    public Boolean setDefaultAdd(String userId, String addId) throws JeecgBootException {
        try{
            nurseHomeAddrMapper.setDefaultAdd(userId, addId);
            return true;
        }
        catch (Exception e){
            throw new JeecgBootException("设置失败");
        }
    }
}
